import { request } from '@/utils/axiosInstance.js'

export const login = (data) => {
    return request({
        url: '/user/login',
        method: 'POST',
        data
    })
}
export const register = (data) => {
    return request({
        url: '/user/create',
        method: 'POST',
        data: {
            ...data,
            role: '2'
        }
    })
}

export const getList = (data) => {
    return request({
        url: '/user/getAll',
        method: 'POST',
        data
    })
}

export const create = (data) => {
    return request({
        url: '/user/create',
        method: 'POST',
        data
    })
}

export const getById = (data) => {
    return request({
        url: '/user/getById',
        method: 'POST',
        data
    })
}

export const update = (data) => {
    return request({
        url: '/user/update',
        method: 'POST',
        data
    })
}

export const del = (data) => {
    return request({
        url: '/user/delete',
        method: 'POST',
        data
    })
}